package com.boyu.service;

import com.boyu.common.SystemConst;
import com.boyu.common.model.Fuser;
import com.jfinal.plugin.activerecord.Page;

/**
 * @author changan.hca
 * @date 2017/7/2
 */
public class FuserService {

    public Page<Fuser> getFuserPage(int pageNo) {
        Page<Fuser> paginate = Fuser.dao.paginate(pageNo, SystemConst.PAGE_SIZE, "select *", " from t_fuser");
        return paginate;
    }

    public Fuser get(String username){
        Fuser fuser = Fuser.dao.findFirst("select * from t_fuser where name=?", username);
        return fuser;
    }

    public Fuser getByEmail(String email){
        Fuser fuser = Fuser.dao.findFirst("select * from t_fuser where email=?", email);
        return fuser;
    }
}
